﻿using System;

namespace Netbits.Common.Conditions
{
	/// <summary>
	/// Represent condition-handling functions
	/// </summary>
	public static class Condition
	{
		/// <summary>
		/// Requires-Validation-Handling
		/// </summary>
		/// <typeparam name="T">Type of value</typeparam>
		/// <param name="Value_">The value to check</param>
		/// <returns>The typed validator, otherwise exception</returns>
		public static Validator<T> Requires<T>( T Value_ )
		{
			return new Validator<T>( Value_, string.Empty );
		}

		/// <summary>
		/// Requires validation handling
		/// </summary>
		/// <typeparam name="T">Type of value</typeparam>
		/// <param name="Value_">The value to check</param>
		/// <param name="Description_">Description/Argument-Name of the value</param>
		/// <returns>The typed validator, otherwise exception</returns>
		/// <exception cref="ArgumentNullException"></exception>
		/// <exception cref="ConditionException"></exception>
		public static Validator<T> Requires<T>( T Value_, string Description_ )
		{
			return new Validator<T>( Value_, Description_ );
		}
	}
}
